import axios from 'axios'
import { Indicator } from 'mint-ui';

var request = axios.create({
    baseURL:'/maizuo'
})

request.interceptors.request.use((config)=>{
    config.headers["X-Client-Info"]=`{"a":"3000","ch":"1002","v":"5.0.4","e":"15725235213350074492263"}`
    if(config.data["X-Host"]){
      config.headers["X-Host"]=config.data["X-Host"]
    }
    Indicator.open({
     text: 'Loading...',
     spinnerType: 'fading-circle'
   });
     return config;
 })
 request.interceptors.response.use((res)=>{
     Indicator.close()
     return res;
 })

export  {request}